home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Development Tools & Languages / Dylan Related / Mindy-1.1 (sources only) / mindy-1.1 / libraries / dylan / char.dylan < prev    next >
Encoding:
Text File  |  1994-06-28  |  1.6 KB  |  51 lines  |  [TEXT/ttxt]

  1. module: Dylan
  2. rcs-header: $Header: char.dylan,v 1.3 94/06/27 17:10:16 wlott Exp $
  3.  
  4. //======================================================================
  5. //
  6. // Copyright (c) 1994  Carnegie Mellon University
  7. // All rights reserved.
  8. // 
  9. // Use and copying of this software and preparation of derivative
  10. // works based on this software are permitted, including commercial
  11. // use, provided that the following conditions are observed:
  12. // 
  13. // 1. This copyright notice must be retained in full on any copies
  14. //    and on appropriate parts of any derivative works.
  15. // 2. Documentation (paper or online) accompanying any system that
  16. //    incorporates this software, or any part of it, must acknowledge
  17. //    the contribution of the Gwydion Project at Carnegie Mellon
  18. //    University.
  19. // 
  20. // This software is made available "as is".  Neither the authors nor
  21. // Carnegie Mellon University make any warranty about the software,
  22. // its performance, or its conformity to any specification.
  23. // 
  24. // Bug reports, questions, comments, and suggestions should be sent by
  25. // E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  26. //
  27. //======================================================================
  28. //
  29. // This file contains the support for characters that isn't built in.
  30. //
  31.  
  32. define method \< (c1 :: <character>, c2 :: <character>)
  33.   as(<integer>, c1) < as(<integer>, c2);
  34. end;
  35.  
  36. define method as-uppercase (c :: <character>)
  37.   if ('a' <= c & c <= 'z')
  38.     as(<character>, as(<integer>, c) - 32);
  39.   else
  40.     c;
  41.   end;
  42. end;
  43.  
  44. define method as-lowercase (c :: <character>)
  45.   if ('A' <= c & c <= 'Z')
  46.     as(<character>, as(<integer>, c) + 32);
  47.   else
  48.     c;
  49.   end;
  50. end;
  51.